<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<title>Real Home A Real Estate Category Flat Bootstarp Resposive Website Template | Suggestion</title>
<link href="/myhouse/static/web/css/bootstrap.css" rel="stylesheet" type="text/css" media="all" />
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="/myhouse/static/web/js/jquery.min.js"></script>
<!-- Custom Theme files -->
<!--menu-->
<script src="/myhouse/static/web/js/scripts.js"></script>
<link href="/myhouse/static/web/css/styles.css" rel="stylesheet">
<!--//menu-->
<!--theme-style-->
<link href="/myhouse/static/web/css/style.css" rel="stylesheet" type="text/css" media="all" />
<!--//theme-style-->
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="Real Home Responsive web template, Bootstrap Web Templates, Flat Web Templates, Andriod Compatible web template, 
Smartphone Compatible web template, free webdesigns for Nokia, Samsung, LG, SonyErricsson, Motorola web design" />
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
</head>
<body>
<script src="/myhouse/static/web/js/easyResponsiveTabs.js" type="text/javascript"></script>
<script type="text/javascript">
	$(document).ready(function () {
		$('#horizontalTab').easyResponsiveTabs({
			type: 'default', //Types: default, vertical, accordion
			width: 'auto', //auto or any width like 600px
			fit: true   // 100% fit in a container
		});
	});
</script>
<!--header-->
<jsp:include page="/inc/head.jsp"></jsp:include>
<!--//-->	
<div class=" banner-buying">
	<div class=" container">
	<h3>MYHOUSE</h3>
	<!---->
<jsp:include page="/inc/menu.jsp"></jsp:include>
	<div class="clearfix"> </div>
		<!--initiate accordion-->
		<script type="text/javascript">
			$(function() {
			    var menu_ul = $('.menu > li > ul'),
			           menu_a  = $('.menu > li > a');
			    menu_ul.hide();
			    menu_a.click(function(e) {
			        e.preventDefault();
			        if(!$(this).hasClass('active')) {
			            menu_a.removeClass('active');
			            menu_ul.filter(':visible').slideUp('normal');
			            $(this).addClass('active').next().stop(true,true).slideDown('normal');
			        } else {
			            $(this).removeClass('active');
			            $(this).next().stop(true,true).slideUp('normal');
			        }
			    });
			
			});
		</script>
      		
	</div>
</div>
<!--//header-->
<!--contact-->
<div class="feedback">
	<div class="container">
		<h3>意见反馈</h3>
		<div class="feedback-top">
			<c:if test="${empty sessionScope.user}">
				<div style="display: flex;justify-content: center">
					<span style="font-size: 40px">请先登录</span>
					<span style="font-size: 15px ; position: relative ;position: relative;top: 100px "><a href="/myhouse/web/login" style="text-decoration: none">已加入MYHOUSE? 去登录>></a></span>
				</div>
			</c:if>
			<c:if test="${not empty sessionScope.user}">
					<input type="text"  placeholder="您的名字(必填)"  value="${sessionScope.user.userName}" disabled id="name">
					<input type="text"  placeholder="您的邮箱(必填)"  value="${sessionScope.user.userPhone}" disabled id="email">
					<input type="text"  placeholder="您的手机号(必填)" value="${sessionScope.user.userEmail}" disabled id="phone">
					<input type="text"  placeholder="中介用户名(选填)" id="mediatorName"  >
					<textarea  placeholder="您的宝贵建议(必填)" requried="" id="feedBack"></textarea>
					<span id="span"></span><br><br>
					 <label class="hvr-sweep-to-right">
					<input type="button" value="提交">
				   </label>
			</c:if>

			<script type="text/javascript" src="/static/web/js/jquery-3.2.1.min.js"></script>
			<script type="text/javascript">
				$(function (){
					$("input[type='button']").click(yz)
				});
				function yz(){
					var info = yzInfo();
					var feed = yzFeed();
					var name = $("#name").val()
					var email= $("#email").val()
					var phone = $("#phone").val()
					var mediator = $("#mediatorName").val()
					var feedBack = $("#feedBack").val()
					if (info && feed){
						$.ajax({
							url:"/myhouse/web/addFeedBack",
							type: "post",
							data:{
								userName:name,
								userPhone:phone,
								userEmail:email,
								mediatorName:mediator,
								feedBack:feedBack
							},
							success:function (mes){
								alert("提交成功")
								$("#feedBack").val("")
							}
						});
					}
				}
				function yzInfo(){
					var phone = $("#phone").val()
					var email = $("#email").val()
					if (phone == "" || email == ""){
						alert("请先完善个人信息")
						return false;
					}else {
						return true;
					}
				}
				function yzFeed(){
					var feed = $("#feedBack").val();
					if (feed == ""){
						$("#span").text("建议为必填项");
						$("#span").css("color","red");
						return false;
					}else {
						return true;
					}
				}
			</script>



		</div>
	</div>
</div>
<!--//contact-->
<!--footer-->
<jsp:include page="/inc/footer.jsp"></jsp:include>
<!--//footer-->
</body>
</html>